<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
     function Person(name,age){
         this.name = name;
         this.age = age;
     }   
     
     Person.prototype.eat = function (){
         console.log("共享方法");
     }

     var person = new Person("wx",15);
     var person2 = new Person("wx",18);

     console.log(person == person2);
     console.log(person.eat == person2.eat);

    </script>
</body>
</html>